<template>
	<view>
		<navigator url="/pages/APIpages/LogPage/LogPage">
			<button>打印日志</button>
		</navigator>
		<navigator url="/pages/APIpages/TimerPage/TimerPage">
			<button>计时器</button>
		</navigator>
		<!-- <navigator url="/pages/APIpages/StoragePage/StoragePage"> -->
		<button @click="goStoPage()">数据缓存</button>
		<!-- </navigator> -->
		<navigator url="/pages/APIpages/RefreshPage/RefreshPage">
			<button>下拉刷新</button>
		</navigator>
		<navigator url="/pages/APIpages/selectImage/selectImage">
			<button>选择图片</button>
		</navigator>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		onLoad() {
			
			// preloadPage预加载
			// 发现80%都点这个页面，可以让打开api的时候，就加载这个页面
			// 用户在打开的时候快一点，提升用户体验
			uni.preloadPage({
				url: "/pages/APIpages/StoragePage/StoragePage"
			})
		},
		methods: {
			goStoPage() {
				// 保留当前页，跳转过去
				uni.navigateTo({
					url: "/pages/APIpages/StoragePage/StoragePage",
					success(){
						console.log('navigator----->success');
					},
					fail(e) {
						console.log('navigateTo---->fail'+JSON.stringify(e))
					},
					complete() {
						console.log('navigator----->complete');
					}
				})
				// 关闭当前页，跳转过去
				// uni.redirectTo({
				// 	url:"/pages/APIpages/StoragePage/StoragePage"
				// })
				// 跳转正常页面可以传参，跳转tab页面不能传参，所以要用到数据缓存
				// tab页要用switchTab
				// reLaunch关闭所有页，打开这一页
				// navigateBack回退
				// preloadPage预加载

			}
		}
	}
</script>

<style>

</style>